package com.example.demo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.demo.entity.Company;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.mapstruct.Mapper;

import java.util.List;

@Mapper
public interface CompanyMapper extends BaseMapper<Company> {
    @Select("<script>select * from company where 1 = 1 order by rank " +
            "<if test=\" example != null and begin != -1 and limit != -1 \"> Limit #{begin}, #{limit} </if>" +
            "</script>")
    List<Company> selectAll(@Param("begin")int begin,
                            @Param("limit")int limit,
                            @Param("example") Company example);
}
